demos: Fix glarea demo on OpenGL/ES
authorChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 3 Aug 2018 07:54:48 +0000 (15:54 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 30 Jul 2020 06:26:33 +0000 (14:26 +0800)
Some implementations of the ES 1.00 shader (such as Google's ANGLE) do
not like the 'f' suffix for floats, so just drop it, as it should be
harmless to drop.

demos/gtk-demo/glarea-gles.fs.glsl

index 39f7143960cb4a499e78eb7d8a45482a3f6b1e35..ac5e1950312ddd120b6edaad59ed16678301be57 100644 (file)
@@ -1,7 +1,7 @@
 precision highp float;
 
 void main() {
-  float lerpVal = gl_FragCoord.y / 500.0f;
+  float lerpVal = gl_FragCoord.y / 500.0;
 
-  gl_FragColor = mix(vec4(1.0f, 0.85f, 0.35f, 1.0f), vec4(0.2f, 0.2f, 0.2f, 1.0f), lerpVal);
+  gl_FragColor = mix(vec4(1.0, 0.85, 0.35, 1.0), vec4(0.2, 0.2, 0.2, 1.0), lerpVal);
 }